<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<body>
<div th:fragment="leftbar">
    <!-- Navbar -->
    <nav class="main-header navbar navbar-expand navbar-white navbar-light">
        <!-- Left navbar links -->
        <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fa fa-bars"></i></a>
            </li>
        </ul>

        <!-- Right navbar links -->
        <ul class="navbar-nav ml-auto">
            <!-- Messages Dropdown Menu -->
            <li class="nav-item dropdown">
                <a class="nav-link" target="_blank" href="/index">
                    <i class="fa fa-paper-plane"></i>
                    <span>博客前台首页</span>
                </a>
            </li>
        </ul>
    </nav>
    <!-- /.navbar -->

    <!-- Main Sidebar Container -->
    <aside class="main-sidebar sidebar-dark-primary elevation-4">
        <!-- Brand Logo -->
        <h1>
            <a href="/admin" class="brand-link">
                <img th:src="${session.USER_SESSION.getPhoto()}" class="brand-image img-circle elevation-3">
                <span class="brand-text font-weight-light" th:text="${session.USER_SESSION.name}">websiteTitle</span>
            </a>
        </h1>

        <!-- Sidebar -->
        <div class="sidebar">
            <!-- Sidebar Menu -->
            <nav class="mt-2">
                <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                    <!-- Add icons to the links using the .nav-icon class
                         with font-awesome or any other icon font library -->
                    <li class="nav-header">仪表盘</li>
                    <li class="nav-item">
                        <a class="nav-link active">
                            <i class="nav-icon fas fa-tachometer-alt"></i>
                            <p>仪表盘</p>
                        </a>
                    </li>
                    <li class="nav-header">博客编辑</li>
                    <li class="nav-item">
                        <a href="/adminEdit" class="nav-link">
                            <i class="nav-icon fas fa-edit"></i>
                            <p>发布博客</p>
                        </a>
                    </li>
                    <li class="nav-header">管理模块</li>
                    <li class="nav-item">
                        <a href="/adminBlog" class="nav-link">
                            <i class="fa fa-list-alt nav-icon" aria-hidden="true"></i>
                            <p>博客管理</p>
                        </a>
                    </li>

                    <div th:if="${session.USER_SESSION.role ne 'user'}">
                        <li class="nav-item">
                            <a href="/adminCategory" class="nav-link">
                                <i class="fa fa-bookmark nav-icon" aria-hidden="true"></i>
                                <p>分类管理</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/adminTag" class="nav-link">
                                <i class="fa fa-tags nav-icon" aria-hidden="true"></i>
                                <p>标签管理</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/adminComment" class="nav-link">
                                <i class="fa fa-comments nav-icon" aria-hidden="true"></i>
                                <p>评论管理</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/adminUser" class="nav-link">
                                <i class="fa fa-user nav-icon" aria-hidden="true"></i>
                                <p>用户管理</p>
                            </a>
                        </li>
                    </div>

                    <li class="nav-item">
                        <a href="/adminFile" class="nav-link">
                            <i class="fa fa-file-code nav-icon" aria-hidden="true"></i>
                            <p>文件管理</p>
                        </a>
                    </li>
                    <li class="nav-header">系统管理</li>
                    <li class="nav-item">
                        <a href="/adminConfig"
                           class="nav-link">
                            <i class="fa fa-wrench nav-icon"></i>
                            <p>系统配置</p>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="logout" class="nav-link">
                            <i class="fa fa-sign-out-alt nav-icon"></i>
                            <p>安全退出</p>
                        </a>
                    </li>
                </ul>
            </nav>
            <!-- /.sidebar-menu -->
        </div>
        <!-- /.sidebar -->
    </aside>
</div>
</body>
</html>
